﻿
// @STATUS: NOT TESTED YET. 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;

namespace ProyectoEscuela
{

    public partial class frmReportForm : Form{

        ReportDocument _reportDocument;

        public frmReportForm()
        {
            InitializeComponent();
         
        }

        public frmReportForm(ReportDocument rpt)
        {

            InitializeComponent();

            _reportDocument = rpt;
            this.crystalReportViewer1.ReportSource = rpt;
            this.crystalReportViewer1.Show();

        }

        public void setReportDocument(ReportDocument rpt){

            _reportDocument = rpt;
            this.crystalReportViewer1.ReportSource = rpt;
            this.crystalReportViewer1.Show();

        }

        public ReportDocument getReporDocument()
        {
            return this._reportDocument;

        }
        public void printReport()
        {
            this.crystalReportViewer1.PrintReport();

        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.crystalReportViewer1.PrintReport();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.crystalReportViewer1.ExportReport();
        }

    }

}
